package com.example.layui.demo.service;

import com.example.layui.demo.entity.Article;
import com.example.layui.demo.entity.ArticleVO;
import com.example.layui.demo.entity.Result;
import com.example.layui.demo.mapper.ArticleMapper;
import com.example.layui.demo.mapper.CounteMapper;
import com.example.layui.demo.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MyserviceImpl implements MyService {

    @Autowired
    CounteMapper counteMapper;
    @Autowired
    ArticleMapper ArticleMapper;

    @Override
    public Result getCount() {
        return counteMapper.getCount();
    }

    @Override
    public List<Article> getArticleList(ArticleVO articleVO) {
        return ArticleMapper.getArticleList(articleVO);
    }

    @Override
    public List<Article> getArticleList1(Article Article) {
        return testMapper.getArticleList1(Article);
    }


    @Override
    public Integer getArticleCount(ArticleVO articleVo) {
        return ArticleMapper.getArticleCount(articleVo);
    }

    @Override
    public Article getArticleByid(Integer id) {
        return ArticleMapper.getArticleByid(id);
    }

    @Autowired
    TestMapper testMapper;
    @Override
    public int delArticlebyId(Integer id) {
        return testMapper.delArticlebyId(id);
    }


    @Autowired
    ArticleMapper articleMapper;
    @Override
    public int updateArticle1(Article Article) {
        return articleMapper.updateArticle1(Article);
    }

    @Override
    public int deleteByIds(int[] ids) {
        return testMapper.deleteByIds(ids);
    }

    @Override
    public Integer getArticleCountWhere(Article article) {
        return articleMapper.getArticleCountWhere(article);
    }

    @Override
    public int DeleteArticleByids(Integer[] ids) {
        return articleMapper.DeleteArticleByids(ids);
    }

    @Override
    public List<Article> searchByWhere(Article article) {
        return articleMapper.searchByWhere(article);
    }


}
